package com.xxx.mapper;

import com.xxx.pojo.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface EmployeeMapper {


    @Delete("delete from employee where id = #{id};")
    int delById(Long id);

    @Select("select * from employee")
    @ResultMap("employeeResultMap")
    List<Employee> selectAll();


    @Select("select * from employee where id = #{id};")
    @ResultMap("employeeResultMap")
    Employee selectById(Long id);

    @Select("select * from employee  where username = #{username};")
    @ResultMap("employeeResultMap")
    Employee selectByUsername(String username);


    @Insert("insert into employee values (#{id}, #{name}, #{username}, #{password}, #{phone}, #{sex}, #{idNumber}, #{status}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})")
    int addEmployee(Employee employee);

    int updateEmployee(@Param("column")String column,@Param("data")String data,@Param("updateTime")String updateTime,@Param("updateUser")Long updateUser, @Param("id")Long id);

    Employee selectEmployee(Employee employee);
}
